<?php
if(!empty($_FILES)){
    $imgurl = $_FILES["file"]["tmp_name"];
    include("idapi.php");
    $a = new test();
    $info = $a->xfyun($imgurl);
    $info = json_decode($info,true)['data'];
    echo '
    身份证号：'.$info['id_number'].'<br/>
    姓名：'.$info['name'].'<br/>
    民族：'.$info['people'].'<br/>
    性别：'.$info['sex'].'<br/>
    出生年月：'.$info['birthday'].'<br/>
    地址：'.$info['address'].'<br/>
    ';
    //var_dump($info);
    die;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>智能识别身份证信息</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    
<style>
.container{max-width: 500px;margin:0 auto;}
.navbar-brand{
	height:60px;
	line-height: 35px;
	font-size: 20px;
}
</style>
</head>
<body style="">

<div class=".col-xs-12">
<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
        <div class="container">
            <div class="row" style="padding: 20px 0">
                <center><h3>上传身份证图片文件</h3></center>
            </div>
            
            <div class="row form-group">
                <div class="col-lg-12 col-md-12">
                    <input class="form-control" name="file"  type="file" >
                </div>
            </div>
            
           
            <div class="row form-group" style="margin-top:20px;">
                <div class="col-lg-12 col-md-12">
                    <input class="form-control" name="" type="submit" style="background: #093;font-size: 15px;color: white; height:40px;">
                </div>
            </div>
        </div>
    </form>
    <script>
    	function getsoncate(id){
			$(function(){
				$.ajax({
					type: "GET",
					url: "../common/action-ajax.php",
					data: {action:'getbillsoncategory',id:id},
					dataType: "text",
					success: function(res){
						if(res.length<10){$('#soncate').html('');}
						else{
							$('#soncate').html(res);
						}
					}
				});	
			});
		}
        function check(){
            if($('#count').val() == ''){alert('请输入账单金额！');$('#count').focus();return false;}
            if($('#category').val() == '0'){alert('请选择账单分类！');$('#category').focus();return false;}
            if($('#description').val() == ''){alert('请输入账单说明！');$('#description').focus();return false;}
        }
    </script>
</div>
<style>
@media screen and (min-width:1000px) {
    .navfooter {
        background: #eee;
        padding: 9px 0 5px 0;
        position: fixed;
        left: 50%;
        margin-left: -500px;
        bottom: 0;
        width:100%;
    }
}
@media screen and (max-width:1000px) {
    .navfooter {
        background: #eee;
        padding: 9px 0 5px 0;
        position: fixed;
        left: 0;
        bottom: 0;
        width:100%;
    }
}
.navfooter .foot-item {
    width:25%;
    float: left;
    text-align: center;
    color: white;
    margin-top:2px;
}
.navfooter .foot-item a{
    color: #4888af;
}
.navfooter .foot-item a span{
    font-size: 20px;
    margin-bottom: 5px;
}
</style>
<div class="col-12" style="height:60px;"></div>


</body>
</html>